<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建样式</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/js/spectrum/spectrum.css">
    <link href="__PUBLIC__/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
</head>
<include file="Admin@Index:cache" />
<body class="gray-bg contacts">
<style>
    .table-hover>tbody>tr>td{
        height:4rem;
    }
</style>
<div class="wrapper wrapper-content animated fadeInRight" oncopy="copyval()">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>创建样式</h5>
                    <div class="ibox-tools">
                        <a href="javascript:;" class="btn btn-success btn-xs" onclick="apply('')" >创建样式</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="col-sm-12" style="margin-bottom: 1rem">
                        <form role="form" action="__SELF__" method="get">
                            <div class="form-group">
                                <input type="text" id="content" placeholder="" name="content" class="form-control">
                            </div>
                            <div>
                                <!--<select name="state" id="state" class="form-control m-b"  style="margin-bottom: 0;padding-top: 3px;display: inline;width: 10%;" >
                                    <option value="">状态</option>
                                    <option value="1" <if condition="$_GET['state'] eq 1">selected</if>>未使用</option>
                                    <option value="2" <if condition="$_GET['state'] eq 2">selected</if>>已使用</option>
                                </select>-->
                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" id="search"><strong>搜索</strong></button>
                            </div>
                        </form>
                    </div>
                    <br>
                    <table class="table table-striped table-hover">
                        <tbody>
                        <tr>
                            <th>主题</th>
                            <th>banner图</th>
                            <th>主题颜色</th>
                            <th>启动状态</th>
                            <th>创建时间</th>
                            <th class="client-status" width="320px">操作</th>
                        </tr>
                        <foreach name="list" item="list">
                            <tr>
                                <td><{$list.title}></td>
                                <td><img src="<{$list.banner}>" style="width: 100px;height: 100px;"></td>
                                <td><div style="width: 100px;height: 100px;background-color: <{$list.color}> "></div></td>
                                <td>
                                    <switch name="list.status">
                                    <case value="1">未启用</case>
                                    <case value="2">已启用</case>
                                    </switch>
                                </td>
                                <td><{$list.ctime}></td>
                                <td class="client-status">
                                    <a class="btn btn-info btn-rounded " href="javascript:void(0);" onclick="apply('<{$list.id}>')">编辑</a>
                                    <a class="btn btn-danger btn-rounded" href="javascript:void(0);" onclick="del('<{$list.id}>');" >删除</a>
                               </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <ul class="pagination">
                        <if condition="$tol gt 10">
                            <{$fpage}>
                        </if>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="__PUBLIC__/admin/js/spectrum/docs/jquery-2.1.0.js"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/admin/js/layer/layer.js"></script>
<script src="__PUBLIC__/admin/js/layui/layui.js"></script>
<script src="__PUBLIC__/admin/js/spectrum/spectrum.js"></script>
<script src='__PUBLIC__/admin/js/spectrum/docs/docs1.js'></script>
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/plugins/fancybox/jquery.fancybox.js"></script>
<script>
    $(document).ready(function () {
        $('.contact-box').each(function () {
            animationHover(this, 'pulse');
        });
    });
    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });
    function apply(id){
        layer.open({
            type: 2, //Page层类型
            area: ['800px', '550px'],
            title: '编辑样式',
            shade: 0.6, //遮罩透明度
            maxmin: true, //允许全屏最小化
            anim: 1, //0-6的动画形式，-1不开启
            content: '__MODULE__/Operate/edit_style?id='+id
        });
    }

    function applys(){
        window.location.reload();
    }
    var op=1;
    var picop=1;
    //删除
    function del(id){
        if(op==2){
            layer.close(index);
            layer.msg('请勿重复点击',{icon:5,time:2000});
            return false;
        }
        op=2;
        var index = layer.load(1, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });
        layer.confirm('是否确定删除该样式',function(){
            $.post('__MODULE__/Operate/delstyle',{id:id},function(data){
                op=1;
                layer.closeAll();
                if(data.code=='1001'){
                    window.location.reload();
                }else{
                    if(data.status=='0'){
                        layer.msg(data.info,{time:2000,icon:5});
                    }else{
                        layer.msg(data.result,{time:2000,icon:5});
                    }
                }
            });
        });
    }


    function copyval() {
        var content = window.getSelection().toString();
        $.post('__MODULE__/Mypublic/copy_all', {content:content}, function (data) {
            if (data.code == '1001') {
            } else {
                console.log(data);
            }
        });
    }
</script>


</body>

</html>
